package Data::Conveyor::YAML::Active::Tx;

# $Id: Tx.pm 9275 2005-06-21 13:58:39Z gr $

use warnings;
use strict;
use YAML::Active qw/assert_hashref hash_activate/;


our $VERSION = '0.02';


use base 'Class::Scaffold::YAML::Active';


sub yaml_activate {
    my ($self, $phase) = @_;
    assert_hashref($self);
    my $hash = hash_activate($self, $phase);

    {
        object_type => $hash->{object_type} || get_objecttype($hash->{objectid}),
        objectid   => $hash->{objectid},
        command    => $hash->{command},
        txtype     => $hash->{txtype}    || $self->delegate->TXT_EXPLICIT,
        status     => $hash->{status}    || $self->delegate->TXS_RUNNING,
        necessity  => $hash->{necessity} || $self->delegate->TXN_MANDATORY,
        exists $hash->{objectcreated}
            ? (objectcreated => $hash->{objectcreated})
            : (),
    }
}


sub get_objecttype {
    my $objectid = shift;
    (my $object_type) = $objectid =~ /^(\w+)\.\d/;
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - stage-based conveyor-belt-like ticket handling system

=head1 SYNOPSIS

    {% p.package %}->new;

=head1 DESCRIPTION

None yet. This is an early release; fully functional, but undocumented. The
next release will have more documentation.

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

